home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8721 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: digital.netvoyage.net!not-for-mail
  2. From: abu@digital.netvoyage.net (Abu Wawda)
  3. Newsgroups: comp.lang.c++
  4. Subject: Anyone Using g++ With C++ Templates?
  5. Date: 25 Feb 1996 23:11:54 -0800
  6. Organization: NetVoyage
  7. Message-ID: <4grmfq$cs7@digital.netvoyage.net>
  8. NNTP-Posting-Host: digital.netvoyage.net
  9. X-Ident: abu
  10. X-Warning: X-Ident uses identd and is subject to forgery. Be careful.
  11.  
  12.  
  13. I simply can't get my files to compile with g++, so please help. I have
  14. this problem only with C++ programs using templates. I have three files:
  15. list.h, list.C, and sample.C. list.h contains the declarations for my list
  16. class (which uses templates). list.C includes list.h and implements the
  17. class. sample.C includes list.h and is a sample that creates a list object
  18. and does a few things with it. This is how I compile them:
  19.  
  20.     g++ -c sample.C
  21.     g++ -c list.C
  22.     g++ sample.o list.o
  23.  
  24. The first two commands give no errors whatsoever. But when I try to link the
  25. two object files together on the third line I get this:
  26.  
  27. sample.o: Undefined symbol `___t4List1Zi' referenced from text segment
  28. sample.o: Undefined symbol `_Insert__t4List1Zii' referenced from text segment
  29. sample.o: Undefined symbol `_PrintList__t4List1Zi' referenced from text segment
  30. sample.o: Undefined symbol `_Delete__t4List1Zii' referenced from text segment
  31. sample.o: Undefined symbol `_Find__t4List1Zii' referenced from text segment
  32. sample.o: Undefined symbol `__$_t4List1Zi' referenced from text segment
  33.  
  34. Why? Please help, I simply can't figure this out. Thanks in advance,
  35.  
  36. Abu Wawda
  37. abu@netvoyage.net
  38. -- 
  39. ---------------------------------------------------------------------------
  40.         Abu Wawda        |        abu@netvoyage.net         |  Live Long
  41.                          |   http://www.netvoyage.net/abu   | And Prosper.
  42. ---------------------------------------------------------------------------
  43.